package model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * Profile entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "profile", catalog = "clode")
public class Profile implements java.io.Serializable {

	// Fields

	private Integer id;
	private User user;
	private Boolean gender;
	private Integer age;
	private String ocuppy;
	private String school;

	// Constructors

	/** default constructor */
	public Profile() {
	}

	/** minimal constructor */
	public Profile(User user) {
		this.user = user;
	}

	/** full constructor */
	public Profile(User user, Boolean gender, Integer age, String ocuppy,
			String school) {
		this.user = user;
		this.gender = gender;
		this.age = age;
		this.ocuppy = ocuppy;
		this.school = school;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "gender")
	public Boolean getGender() {
		return this.gender;
	}

	public void setGender(Boolean gender) {
		this.gender = gender;
	}

	@Column(name = "age")
	public Integer getAge() {
		return this.age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	@Column(name = "ocuppy", length = 50)
	public String getOcuppy() {
		return this.ocuppy;
	}

	public void setOcuppy(String ocuppy) {
		this.ocuppy = ocuppy;
	}

	@Column(name = "school", length = 50)
	public String getSchool() {
		return this.school;
	}

	public void setSchool(String school) {
		this.school = school;
	}

}